import {Actor, Action} from 'iflux2';
import {UserType} from '../constant/action-type';
import {Map} from 'immutable';

export default class UserActor extends Actor {
    defaultState() {
        return {
            users: [],
            chooseUser: {}
        }
    }


    @Action(UserType.SET_USERS)
    setUsers(state, users) {
        return state.set('users', users);e
    }


    @Action(UserType.SET_CHOOSE)
    setChoose(state, user) {
        return state.set('chooseUser', user);
    }


    @Action(UserType.RESET_CHOOSE)
    resetChoose(state) {
        return state.set('chooseUser', Map());
    }
}